Left Termination of the query pattern merge_in_3(g, g, a) w.r.t. the given Prolog program could successfully be proven:



Prolog
  ↳ PrologToPiTRSProof

Clauses:

merge([], X, X).
merge(X, [], X).
merge(.(X, Xs), .(Y, Ys), .(X, Zs)) :- ','(leq(X, Y), merge(Xs, .(Y, Ys), Zs)).
merge(.(X, Xs), .(Y, Ys), .(Y, Zs)) :- ','(less(Y, X), merge(.(X, Xs), Ys, Zs)).
less(0, s(0)).
less(s(X), s(Y)) :- less(X, Y).
leq(0, 0).
leq(0, s(0)).
leq(s(X), s(Y)) :- leq(X, Y).

Queries:

merge(g,g,a).

We use the technique of [30].Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

merge_in(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U3(X, Xs, Y, Ys, Zs, less_in(Y, X))
less_in(s(X), s(Y)) → U5(X, Y, less_in(X, Y))
less_in(0, s(0)) → less_out(0, s(0))
U5(X, Y, less_out(X, Y)) → less_out(s(X), s(Y))
U3(X, Xs, Y, Ys, Zs, less_out(Y, X)) → U4(X, Xs, Y, Ys, Zs, merge_in(.(X, Xs), Ys, Zs))
merge_in(.(X, Xs), .(Y, Ys), .(X, Zs)) → U1(X, Xs, Y, Ys, Zs, leq_in(X, Y))
leq_in(s(X), s(Y)) → U6(X, Y, leq_in(X, Y))
leq_in(0, s(0)) → leq_out(0, s(0))
leq_in(0, 0) → leq_out(0, 0)
U6(X, Y, leq_out(X, Y)) → leq_out(s(X), s(Y))
U1(X, Xs, Y, Ys, Zs, leq_out(X, Y)) → U2(X, Xs, Y, Ys, Zs, merge_in(Xs, .(Y, Ys), Zs))
merge_in(X, [], X) → merge_out(X, [], X)
merge_in([], X, X) → merge_out([], X, X)
U2(X, Xs, Y, Ys, Zs, merge_out(Xs, .(Y, Ys), Zs)) → merge_out(.(X, Xs), .(Y, Ys), .(X, Zs))
U4(X, Xs, Y, Ys, Zs, merge_out(.(X, Xs), Ys, Zs)) → merge_out(.(X, Xs), .(Y, Ys), .(Y, Zs))

The argument filtering Pi contains the following mapping:
merge_in(x1, x2, x3)  =  merge_in(x1, x2)
.(x1, x2)  =  .(x1, x2)
U3(x1, x2, x3, x4, x5, x6)  =  U3(x1, x2, x3, x4, x6)
less_in(x1, x2)  =  less_in(x1, x2)
s(x1)  =  s(x1)
U5(x1, x2, x3)  =  U5(x3)
0  =  0
less_out(x1, x2)  =  less_out
U4(x1, x2, x3, x4, x5, x6)  =  U4(x3, x6)
U1(x1, x2, x3, x4, x5, x6)  =  U1(x1, x2, x3, x4, x6)
leq_in(x1, x2)  =  leq_in(x1, x2)
U6(x1, x2, x3)  =  U6(x3)
leq_out(x1, x2)  =  leq_out
U2(x1, x2, x3, x4, x5, x6)  =  U2(x1, x6)
[]  =  []
merge_out(x1, x2, x3)  =  merge_out(x3)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

merge_in(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U3(X, Xs, Y, Ys, Zs, less_in(Y, X))
less_in(s(X), s(Y)) → U5(X, Y, less_in(X, Y))
less_in(0, s(0)) → less_out(0, s(0))
U5(X, Y, less_out(X, Y)) → less_out(s(X), s(Y))
U3(X, Xs, Y, Ys, Zs, less_out(Y, X)) → U4(X, Xs, Y, Ys, Zs, merge_in(.(X, Xs), Ys, Zs))
merge_in(.(X, Xs), .(Y, Ys), .(X, Zs)) → U1(X, Xs, Y, Ys, Zs, leq_in(X, Y))
leq_in(s(X), s(Y)) → U6(X, Y, leq_in(X, Y))
leq_in(0, s(0)) → leq_out(0, s(0))
leq_in(0, 0) → leq_out(0, 0)
U6(X, Y, leq_out(X, Y)) → leq_out(s(X), s(Y))
U1(X, Xs, Y, Ys, Zs, leq_out(X, Y)) → U2(X, Xs, Y, Ys, Zs, merge_in(Xs, .(Y, Ys), Zs))
merge_in(X, [], X) → merge_out(X, [], X)
merge_in([], X, X) → merge_out([], X, X)
U2(X, Xs, Y, Ys, Zs, merge_out(Xs, .(Y, Ys), Zs)) → merge_out(.(X, Xs), .(Y, Ys), .(X, Zs))
U4(X, Xs, Y, Ys, Zs, merge_out(.(X, Xs), Ys, Zs)) → merge_out(.(X, Xs), .(Y, Ys), .(Y, Zs))

The argument filtering Pi contains the following mapping:
merge_in(x1, x2, x3)  =  merge_in(x1, x2)
.(x1, x2)  =  .(x1, x2)
U3(x1, x2, x3, x4, x5, x6)  =  U3(x1, x2, x3, x4, x6)
less_in(x1, x2)  =  less_in(x1, x2)
s(x1)  =  s(x1)
U5(x1, x2, x3)  =  U5(x3)
0  =  0
less_out(x1, x2)  =  less_out
U4(x1, x2, x3, x4, x5, x6)  =  U4(x3, x6)
U1(x1, x2, x3, x4, x5, x6)  =  U1(x1, x2, x3, x4, x6)
leq_in(x1, x2)  =  leq_in(x1, x2)
U6(x1, x2, x3)  =  U6(x3)
leq_out(x1, x2)  =  leq_out
U2(x1, x2, x3, x4, x5, x6)  =  U2(x1, x6)
[]  =  []
merge_out(x1, x2, x3)  =  merge_out(x3)


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

MERGE_IN(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U31(X, Xs, Y, Ys, Zs, less_in(Y, X))
MERGE_IN(.(X, Xs), .(Y, Ys), .(Y, Zs)) → LESS_IN(Y, X)
LESS_IN(s(X), s(Y)) → U51(X, Y, less_in(X, Y))
LESS_IN(s(X), s(Y)) → LESS_IN(X, Y)
U31(X, Xs, Y, Ys, Zs, less_out(Y, X)) → U41(X, Xs, Y, Ys, Zs, merge_in(.(X, Xs), Ys, Zs))
U31(X, Xs, Y, Ys, Zs, less_out(Y, X)) → MERGE_IN(.(X, Xs), Ys, Zs)
MERGE_IN(.(X, Xs), .(Y, Ys), .(X, Zs)) → U11(X, Xs, Y, Ys, Zs, leq_in(X, Y))
MERGE_IN(.(X, Xs), .(Y, Ys), .(X, Zs)) → LEQ_IN(X, Y)
LEQ_IN(s(X), s(Y)) → U61(X, Y, leq_in(X, Y))
LEQ_IN(s(X), s(Y)) → LEQ_IN(X, Y)
U11(X, Xs, Y, Ys, Zs, leq_out(X, Y)) → U21(X, Xs, Y, Ys, Zs, merge_in(Xs, .(Y, Ys), Zs))
U11(X, Xs, Y, Ys, Zs, leq_out(X, Y)) → MERGE_IN(Xs, .(Y, Ys), Zs)

The TRS R consists of the following rules:

merge_in(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U3(X, Xs, Y, Ys, Zs, less_in(Y, X))
less_in(s(X), s(Y)) → U5(X, Y, less_in(X, Y))
less_in(0, s(0)) → less_out(0, s(0))
U5(X, Y, less_out(X, Y)) → less_out(s(X), s(Y))
U3(X, Xs, Y, Ys, Zs, less_out(Y, X)) → U4(X, Xs, Y, Ys, Zs, merge_in(.(X, Xs), Ys, Zs))
merge_in(.(X, Xs), .(Y, Ys), .(X, Zs)) → U1(X, Xs, Y, Ys, Zs, leq_in(X, Y))
leq_in(s(X), s(Y)) → U6(X, Y, leq_in(X, Y))
leq_in(0, s(0)) → leq_out(0, s(0))
leq_in(0, 0) → leq_out(0, 0)
U6(X, Y, leq_out(X, Y)) → leq_out(s(X), s(Y))
U1(X, Xs, Y, Ys, Zs, leq_out(X, Y)) → U2(X, Xs, Y, Ys, Zs, merge_in(Xs, .(Y, Ys), Zs))
merge_in(X, [], X) → merge_out(X, [], X)
merge_in([], X, X) → merge_out([], X, X)
U2(X, Xs, Y, Ys, Zs, merge_out(Xs, .(Y, Ys), Zs)) → merge_out(.(X, Xs), .(Y, Ys), .(X, Zs))
U4(X, Xs, Y, Ys, Zs, merge_out(.(X, Xs), Ys, Zs)) → merge_out(.(X, Xs), .(Y, Ys), .(Y, Zs))

The argument filtering Pi contains the following mapping:
merge_in(x1, x2, x3)  =  merge_in(x1, x2)
.(x1, x2)  =  .(x1, x2)
U3(x1, x2, x3, x4, x5, x6)  =  U3(x1, x2, x3, x4, x6)
less_in(x1, x2)  =  less_in(x1, x2)
s(x1)  =  s(x1)
U5(x1, x2, x3)  =  U5(x3)
0  =  0
less_out(x1, x2)  =  less_out
U4(x1, x2, x3, x4, x5, x6)  =  U4(x3, x6)
U1(x1, x2, x3, x4, x5, x6)  =  U1(x1, x2, x3, x4, x6)
leq_in(x1, x2)  =  leq_in(x1, x2)
U6(x1, x2, x3)  =  U6(x3)
leq_out(x1, x2)  =  leq_out
U2(x1, x2, x3, x4, x5, x6)  =  U2(x1, x6)
[]  =  []
merge_out(x1, x2, x3)  =  merge_out(x3)
LEQ_IN(x1, x2)  =  LEQ_IN(x1, x2)
U61(x1, x2, x3)  =  U61(x3)
U51(x1, x2, x3)  =  U51(x3)
LESS_IN(x1, x2)  =  LESS_IN(x1, x2)
MERGE_IN(x1, x2, x3)  =  MERGE_IN(x1, x2)
U21(x1, x2, x3, x4, x5, x6)  =  U21(x1, x6)
U41(x1, x2, x3, x4, x5, x6)  =  U41(x3, x6)
U11(x1, x2, x3, x4, x5, x6)  =  U11(x1, x2, x3, x4, x6)
U31(x1, x2, x3, x4, x5, x6)  =  U31(x1, x2, x3, x4, x6)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof

Pi DP problem:
The TRS P consists of the following rules:

MERGE_IN(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U31(X, Xs, Y, Ys, Zs, less_in(Y, X))
MERGE_IN(.(X, Xs), .(Y, Ys), .(Y, Zs)) → LESS_IN(Y, X)
LESS_IN(s(X), s(Y)) → U51(X, Y, less_in(X, Y))
LESS_IN(s(X), s(Y)) → LESS_IN(X, Y)
U31(X, Xs, Y, Ys, Zs, less_out(Y, X)) → U41(X, Xs, Y, Ys, Zs, merge_in(.(X, Xs), Ys, Zs))
U31(X, Xs, Y, Ys, Zs, less_out(Y, X)) → MERGE_IN(.(X, Xs), Ys, Zs)
MERGE_IN(.(X, Xs), .(Y, Ys), .(X, Zs)) → U11(X, Xs, Y, Ys, Zs, leq_in(X, Y))
MERGE_IN(.(X, Xs), .(Y, Ys), .(X, Zs)) → LEQ_IN(X, Y)
LEQ_IN(s(X), s(Y)) → U61(X, Y, leq_in(X, Y))
LEQ_IN(s(X), s(Y)) → LEQ_IN(X, Y)
U11(X, Xs, Y, Ys, Zs, leq_out(X, Y)) → U21(X, Xs, Y, Ys, Zs, merge_in(Xs, .(Y, Ys), Zs))
U11(X, Xs, Y, Ys, Zs, leq_out(X, Y)) → MERGE_IN(Xs, .(Y, Ys), Zs)

The TRS R consists of the following rules:

merge_in(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U3(X, Xs, Y, Ys, Zs, less_in(Y, X))
less_in(s(X), s(Y)) → U5(X, Y, less_in(X, Y))
less_in(0, s(0)) → less_out(0, s(0))
U5(X, Y, less_out(X, Y)) → less_out(s(X), s(Y))
U3(X, Xs, Y, Ys, Zs, less_out(Y, X)) → U4(X, Xs, Y, Ys, Zs, merge_in(.(X, Xs), Ys, Zs))
merge_in(.(X, Xs), .(Y, Ys), .(X, Zs)) → U1(X, Xs, Y, Ys, Zs, leq_in(X, Y))
leq_in(s(X), s(Y)) → U6(X, Y, leq_in(X, Y))
leq_in(0, s(0)) → leq_out(0, s(0))
leq_in(0, 0) → leq_out(0, 0)
U6(X, Y, leq_out(X, Y)) → leq_out(s(X), s(Y))
U1(X, Xs, Y, Ys, Zs, leq_out(X, Y)) → U2(X, Xs, Y, Ys, Zs, merge_in(Xs, .(Y, Ys), Zs))
merge_in(X, [], X) → merge_out(X, [], X)
merge_in([], X, X) → merge_out([], X, X)
U2(X, Xs, Y, Ys, Zs, merge_out(Xs, .(Y, Ys), Zs)) → merge_out(.(X, Xs), .(Y, Ys), .(X, Zs))
U4(X, Xs, Y, Ys, Zs, merge_out(.(X, Xs), Ys, Zs)) → merge_out(.(X, Xs), .(Y, Ys), .(Y, Zs))

The argument filtering Pi contains the following mapping:
merge_in(x1, x2, x3)  =  merge_in(x1, x2)
.(x1, x2)  =  .(x1, x2)
U3(x1, x2, x3, x4, x5, x6)  =  U3(x1, x2, x3, x4, x6)
less_in(x1, x2)  =  less_in(x1, x2)
s(x1)  =  s(x1)
U5(x1, x2, x3)  =  U5(x3)
0  =  0
less_out(x1, x2)  =  less_out
U4(x1, x2, x3, x4, x5, x6)  =  U4(x3, x6)
U1(x1, x2, x3, x4, x5, x6)  =  U1(x1, x2, x3, x4, x6)
leq_in(x1, x2)  =  leq_in(x1, x2)
U6(x1, x2, x3)  =  U6(x3)
leq_out(x1, x2)  =  leq_out
U2(x1, x2, x3, x4, x5, x6)  =  U2(x1, x6)
[]  =  []
merge_out(x1, x2, x3)  =  merge_out(x3)
LEQ_IN(x1, x2)  =  LEQ_IN(x1, x2)
U61(x1, x2, x3)  =  U61(x3)
U51(x1, x2, x3)  =  U51(x3)
LESS_IN(x1, x2)  =  LESS_IN(x1, x2)
MERGE_IN(x1, x2, x3)  =  MERGE_IN(x1, x2)
U21(x1, x2, x3, x4, x5, x6)  =  U21(x1, x6)
U41(x1, x2, x3, x4, x5, x6)  =  U41(x3, x6)
U11(x1, x2, x3, x4, x5, x6)  =  U11(x1, x2, x3, x4, x6)
U31(x1, x2, x3, x4, x5, x6)  =  U31(x1, x2, x3, x4, x6)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 3 SCCs with 6 less nodes.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

LEQ_IN(s(X), s(Y)) → LEQ_IN(X, Y)

The TRS R consists of the following rules:

merge_in(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U3(X, Xs, Y, Ys, Zs, less_in(Y, X))
less_in(s(X), s(Y)) → U5(X, Y, less_in(X, Y))
less_in(0, s(0)) → less_out(0, s(0))
U5(X, Y, less_out(X, Y)) → less_out(s(X), s(Y))
U3(X, Xs, Y, Ys, Zs, less_out(Y, X)) → U4(X, Xs, Y, Ys, Zs, merge_in(.(X, Xs), Ys, Zs))
merge_in(.(X, Xs), .(Y, Ys), .(X, Zs)) → U1(X, Xs, Y, Ys, Zs, leq_in(X, Y))
leq_in(s(X), s(Y)) → U6(X, Y, leq_in(X, Y))
leq_in(0, s(0)) → leq_out(0, s(0))
leq_in(0, 0) → leq_out(0, 0)
U6(X, Y, leq_out(X, Y)) → leq_out(s(X), s(Y))
U1(X, Xs, Y, Ys, Zs, leq_out(X, Y)) → U2(X, Xs, Y, Ys, Zs, merge_in(Xs, .(Y, Ys), Zs))
merge_in(X, [], X) → merge_out(X, [], X)
merge_in([], X, X) → merge_out([], X, X)
U2(X, Xs, Y, Ys, Zs, merge_out(Xs, .(Y, Ys), Zs)) → merge_out(.(X, Xs), .(Y, Ys), .(X, Zs))
U4(X, Xs, Y, Ys, Zs, merge_out(.(X, Xs), Ys, Zs)) → merge_out(.(X, Xs), .(Y, Ys), .(Y, Zs))

The argument filtering Pi contains the following mapping:
merge_in(x1, x2, x3)  =  merge_in(x1, x2)
.(x1, x2)  =  .(x1, x2)
U3(x1, x2, x3, x4, x5, x6)  =  U3(x1, x2, x3, x4, x6)
less_in(x1, x2)  =  less_in(x1, x2)
s(x1)  =  s(x1)
U5(x1, x2, x3)  =  U5(x3)
0  =  0
less_out(x1, x2)  =  less_out
U4(x1, x2, x3, x4, x5, x6)  =  U4(x3, x6)
U1(x1, x2, x3, x4, x5, x6)  =  U1(x1, x2, x3, x4, x6)
leq_in(x1, x2)  =  leq_in(x1, x2)
U6(x1, x2, x3)  =  U6(x3)
leq_out(x1, x2)  =  leq_out
U2(x1, x2, x3, x4, x5, x6)  =  U2(x1, x6)
[]  =  []
merge_out(x1, x2, x3)  =  merge_out(x3)
LEQ_IN(x1, x2)  =  LEQ_IN(x1, x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

LEQ_IN(s(X), s(Y)) → LEQ_IN(X, Y)

R is empty.
Pi is empty.
We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

LEQ_IN(s(X), s(Y)) → LEQ_IN(X, Y)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

LESS_IN(s(X), s(Y)) → LESS_IN(X, Y)

The TRS R consists of the following rules:

merge_in(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U3(X, Xs, Y, Ys, Zs, less_in(Y, X))
less_in(s(X), s(Y)) → U5(X, Y, less_in(X, Y))
less_in(0, s(0)) → less_out(0, s(0))
U5(X, Y, less_out(X, Y)) → less_out(s(X), s(Y))
U3(X, Xs, Y, Ys, Zs, less_out(Y, X)) → U4(X, Xs, Y, Ys, Zs, merge_in(.(X, Xs), Ys, Zs))
merge_in(.(X, Xs), .(Y, Ys), .(X, Zs)) → U1(X, Xs, Y, Ys, Zs, leq_in(X, Y))
leq_in(s(X), s(Y)) → U6(X, Y, leq_in(X, Y))
leq_in(0, s(0)) → leq_out(0, s(0))
leq_in(0, 0) → leq_out(0, 0)
U6(X, Y, leq_out(X, Y)) → leq_out(s(X), s(Y))
U1(X, Xs, Y, Ys, Zs, leq_out(X, Y)) → U2(X, Xs, Y, Ys, Zs, merge_in(Xs, .(Y, Ys), Zs))
merge_in(X, [], X) → merge_out(X, [], X)
merge_in([], X, X) → merge_out([], X, X)
U2(X, Xs, Y, Ys, Zs, merge_out(Xs, .(Y, Ys), Zs)) → merge_out(.(X, Xs), .(Y, Ys), .(X, Zs))
U4(X, Xs, Y, Ys, Zs, merge_out(.(X, Xs), Ys, Zs)) → merge_out(.(X, Xs), .(Y, Ys), .(Y, Zs))

The argument filtering Pi contains the following mapping:
merge_in(x1, x2, x3)  =  merge_in(x1, x2)
.(x1, x2)  =  .(x1, x2)
U3(x1, x2, x3, x4, x5, x6)  =  U3(x1, x2, x3, x4, x6)
less_in(x1, x2)  =  less_in(x1, x2)
s(x1)  =  s(x1)
U5(x1, x2, x3)  =  U5(x3)
0  =  0
less_out(x1, x2)  =  less_out
U4(x1, x2, x3, x4, x5, x6)  =  U4(x3, x6)
U1(x1, x2, x3, x4, x5, x6)  =  U1(x1, x2, x3, x4, x6)
leq_in(x1, x2)  =  leq_in(x1, x2)
U6(x1, x2, x3)  =  U6(x3)
leq_out(x1, x2)  =  leq_out
U2(x1, x2, x3, x4, x5, x6)  =  U2(x1, x6)
[]  =  []
merge_out(x1, x2, x3)  =  merge_out(x3)
LESS_IN(x1, x2)  =  LESS_IN(x1, x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

LESS_IN(s(X), s(Y)) → LESS_IN(X, Y)

R is empty.
Pi is empty.
We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

LESS_IN(s(X), s(Y)) → LESS_IN(X, Y)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
PiDP
                ↳ UsableRulesProof

Pi DP problem:
The TRS P consists of the following rules:

MERGE_IN(.(X, Xs), .(Y, Ys), .(X, Zs)) → U11(X, Xs, Y, Ys, Zs, leq_in(X, Y))
U31(X, Xs, Y, Ys, Zs, less_out(Y, X)) → MERGE_IN(.(X, Xs), Ys, Zs)
U11(X, Xs, Y, Ys, Zs, leq_out(X, Y)) → MERGE_IN(Xs, .(Y, Ys), Zs)
MERGE_IN(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U31(X, Xs, Y, Ys, Zs, less_in(Y, X))

The TRS R consists of the following rules:

merge_in(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U3(X, Xs, Y, Ys, Zs, less_in(Y, X))
less_in(s(X), s(Y)) → U5(X, Y, less_in(X, Y))
less_in(0, s(0)) → less_out(0, s(0))
U5(X, Y, less_out(X, Y)) → less_out(s(X), s(Y))
U3(X, Xs, Y, Ys, Zs, less_out(Y, X)) → U4(X, Xs, Y, Ys, Zs, merge_in(.(X, Xs), Ys, Zs))
merge_in(.(X, Xs), .(Y, Ys), .(X, Zs)) → U1(X, Xs, Y, Ys, Zs, leq_in(X, Y))
leq_in(s(X), s(Y)) → U6(X, Y, leq_in(X, Y))
leq_in(0, s(0)) → leq_out(0, s(0))
leq_in(0, 0) → leq_out(0, 0)
U6(X, Y, leq_out(X, Y)) → leq_out(s(X), s(Y))
U1(X, Xs, Y, Ys, Zs, leq_out(X, Y)) → U2(X, Xs, Y, Ys, Zs, merge_in(Xs, .(Y, Ys), Zs))
merge_in(X, [], X) → merge_out(X, [], X)
merge_in([], X, X) → merge_out([], X, X)
U2(X, Xs, Y, Ys, Zs, merge_out(Xs, .(Y, Ys), Zs)) → merge_out(.(X, Xs), .(Y, Ys), .(X, Zs))
U4(X, Xs, Y, Ys, Zs, merge_out(.(X, Xs), Ys, Zs)) → merge_out(.(X, Xs), .(Y, Ys), .(Y, Zs))

The argument filtering Pi contains the following mapping:
merge_in(x1, x2, x3)  =  merge_in(x1, x2)
.(x1, x2)  =  .(x1, x2)
U3(x1, x2, x3, x4, x5, x6)  =  U3(x1, x2, x3, x4, x6)
less_in(x1, x2)  =  less_in(x1, x2)
s(x1)  =  s(x1)
U5(x1, x2, x3)  =  U5(x3)
0  =  0
less_out(x1, x2)  =  less_out
U4(x1, x2, x3, x4, x5, x6)  =  U4(x3, x6)
U1(x1, x2, x3, x4, x5, x6)  =  U1(x1, x2, x3, x4, x6)
leq_in(x1, x2)  =  leq_in(x1, x2)
U6(x1, x2, x3)  =  U6(x3)
leq_out(x1, x2)  =  leq_out
U2(x1, x2, x3, x4, x5, x6)  =  U2(x1, x6)
[]  =  []
merge_out(x1, x2, x3)  =  merge_out(x3)
MERGE_IN(x1, x2, x3)  =  MERGE_IN(x1, x2)
U11(x1, x2, x3, x4, x5, x6)  =  U11(x1, x2, x3, x4, x6)
U31(x1, x2, x3, x4, x5, x6)  =  U31(x1, x2, x3, x4, x6)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof

Pi DP problem:
The TRS P consists of the following rules:

MERGE_IN(.(X, Xs), .(Y, Ys), .(X, Zs)) → U11(X, Xs, Y, Ys, Zs, leq_in(X, Y))
U31(X, Xs, Y, Ys, Zs, less_out(Y, X)) → MERGE_IN(.(X, Xs), Ys, Zs)
U11(X, Xs, Y, Ys, Zs, leq_out(X, Y)) → MERGE_IN(Xs, .(Y, Ys), Zs)
MERGE_IN(.(X, Xs), .(Y, Ys), .(Y, Zs)) → U31(X, Xs, Y, Ys, Zs, less_in(Y, X))

The TRS R consists of the following rules:

leq_in(s(X), s(Y)) → U6(X, Y, leq_in(X, Y))
leq_in(0, s(0)) → leq_out(0, s(0))
leq_in(0, 0) → leq_out(0, 0)
less_in(s(X), s(Y)) → U5(X, Y, less_in(X, Y))
less_in(0, s(0)) → less_out(0, s(0))
U6(X, Y, leq_out(X, Y)) → leq_out(s(X), s(Y))
U5(X, Y, less_out(X, Y)) → less_out(s(X), s(Y))

The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
less_in(x1, x2)  =  less_in(x1, x2)
s(x1)  =  s(x1)
U5(x1, x2, x3)  =  U5(x3)
0  =  0
less_out(x1, x2)  =  less_out
leq_in(x1, x2)  =  leq_in(x1, x2)
U6(x1, x2, x3)  =  U6(x3)
leq_out(x1, x2)  =  leq_out
MERGE_IN(x1, x2, x3)  =  MERGE_IN(x1, x2)
U11(x1, x2, x3, x4, x5, x6)  =  U11(x1, x2, x3, x4, x6)
U31(x1, x2, x3, x4, x5, x6)  =  U31(x1, x2, x3, x4, x6)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPOrderProof

Q DP problem:
The TRS P consists of the following rules:

MERGE_IN(.(X, Xs), .(Y, Ys)) → U31(X, Xs, Y, Ys, less_in(Y, X))
MERGE_IN(.(X, Xs), .(Y, Ys)) → U11(X, Xs, Y, Ys, leq_in(X, Y))
U31(X, Xs, Y, Ys, less_out) → MERGE_IN(.(X, Xs), Ys)
U11(X, Xs, Y, Ys, leq_out) → MERGE_IN(Xs, .(Y, Ys))

The TRS R consists of the following rules:

leq_in(s(X), s(Y)) → U6(leq_in(X, Y))
leq_in(0, s(0)) → leq_out
leq_in(0, 0) → leq_out
less_in(s(X), s(Y)) → U5(less_in(X, Y))
less_in(0, s(0)) → less_out
U6(leq_out) → leq_out
U5(less_out) → less_out

The set Q consists of the following terms:

leq_in(x0, x1)
less_in(x0, x1)
U6(x0)
U5(x0)

We have to consider all (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


U11(X, Xs, Y, Ys, leq_out) → MERGE_IN(Xs, .(Y, Ys))
The remaining pairs can at least be oriented weakly.

MERGE_IN(.(X, Xs), .(Y, Ys)) → U31(X, Xs, Y, Ys, less_in(Y, X))
MERGE_IN(.(X, Xs), .(Y, Ys)) → U11(X, Xs, Y, Ys, leq_in(X, Y))
U31(X, Xs, Y, Ys, less_out) → MERGE_IN(.(X, Xs), Ys)
Used ordering: Polynomial interpretation [25]:

POL(.(x1, x2)) = 1 + x2   
POL(0) = 0   
POL(MERGE_IN(x1, x2)) = x1   
POL(U11(x1, x2, x3, x4, x5)) = 1 + x2   
POL(U31(x1, x2, x3, x4, x5)) = 1 + x2   
POL(U5(x1)) = 0   
POL(U6(x1)) = 0   
POL(leq_in(x1, x2)) = 0   
POL(leq_out) = 0   
POL(less_in(x1, x2)) = 0   
POL(less_out) = 0   
POL(s(x1)) = 0   

The following usable rules [17] were oriented: none



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ QDPOrderProof
QDP
                            ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

MERGE_IN(.(X, Xs), .(Y, Ys)) → U11(X, Xs, Y, Ys, leq_in(X, Y))
MERGE_IN(.(X, Xs), .(Y, Ys)) → U31(X, Xs, Y, Ys, less_in(Y, X))
U31(X, Xs, Y, Ys, less_out) → MERGE_IN(.(X, Xs), Ys)

The TRS R consists of the following rules:

leq_in(s(X), s(Y)) → U6(leq_in(X, Y))
leq_in(0, s(0)) → leq_out
leq_in(0, 0) → leq_out
less_in(s(X), s(Y)) → U5(less_in(X, Y))
less_in(0, s(0)) → less_out
U6(leq_out) → leq_out
U5(less_out) → less_out

The set Q consists of the following terms:

leq_in(x0, x1)
less_in(x0, x1)
U6(x0)
U5(x0)

We have to consider all (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 1 SCC with 1 less node.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ QDPOrderProof
                          ↳ QDP
                            ↳ DependencyGraphProof
QDP
                                ↳ UsableRulesProof

Q DP problem:
The TRS P consists of the following rules:

MERGE_IN(.(X, Xs), .(Y, Ys)) → U31(X, Xs, Y, Ys, less_in(Y, X))
U31(X, Xs, Y, Ys, less_out) → MERGE_IN(.(X, Xs), Ys)

The TRS R consists of the following rules:

leq_in(s(X), s(Y)) → U6(leq_in(X, Y))
leq_in(0, s(0)) → leq_out
leq_in(0, 0) → leq_out
less_in(s(X), s(Y)) → U5(less_in(X, Y))
less_in(0, s(0)) → less_out
U6(leq_out) → leq_out
U5(less_out) → less_out

The set Q consists of the following terms:

leq_in(x0, x1)
less_in(x0, x1)
U6(x0)
U5(x0)

We have to consider all (P,Q,R)-chains.
As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [15] we can delete all non-usable rules [17] from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ QDPOrderProof
                          ↳ QDP
                            ↳ DependencyGraphProof
                              ↳ QDP
                                ↳ UsableRulesProof
QDP
                                    ↳ QReductionProof

Q DP problem:
The TRS P consists of the following rules:

MERGE_IN(.(X, Xs), .(Y, Ys)) → U31(X, Xs, Y, Ys, less_in(Y, X))
U31(X, Xs, Y, Ys, less_out) → MERGE_IN(.(X, Xs), Ys)

The TRS R consists of the following rules:

less_in(s(X), s(Y)) → U5(less_in(X, Y))
less_in(0, s(0)) → less_out
U5(less_out) → less_out

The set Q consists of the following terms:

leq_in(x0, x1)
less_in(x0, x1)
U6(x0)
U5(x0)

We have to consider all (P,Q,R)-chains.
We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.

leq_in(x0, x1)
U6(x0)



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ QDPOrderProof
                          ↳ QDP
                            ↳ DependencyGraphProof
                              ↳ QDP
                                ↳ UsableRulesProof
                                  ↳ QDP
                                    ↳ QReductionProof
QDP
                                        ↳ QDPSizeChangeProof

Q DP problem:
The TRS P consists of the following rules:

MERGE_IN(.(X, Xs), .(Y, Ys)) → U31(X, Xs, Y, Ys, less_in(Y, X))
U31(X, Xs, Y, Ys, less_out) → MERGE_IN(.(X, Xs), Ys)

The TRS R consists of the following rules:

less_in(s(X), s(Y)) → U5(less_in(X, Y))
less_in(0, s(0)) → less_out
U5(less_out) → less_out

The set Q consists of the following terms:

less_in(x0, x1)
U5(x0)

We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs: